#include <stdio.h>
#include <math.h>
int main (void) {
double x1 ,x2 ,y1 ,y2 ,midx ,midy ,m ,n ,c;
printf ("Enter the x , y coordinates of the first point :") ;
scanf ("%lf%lf",&x1, &y1);
printf ("Enter the x , y coordinates of the scend point :");
scanf ("%lf%lf",&x2, &y2);
midx=(x1+x2)/2;
midy=(y1+y2)/2;
m=(y2-y1)/(x2-x1);
n=-1/m;
c=-n*midx+midy;
printf("point1 is:(%0.2f,%0.2f)\n", x1, y1);
printf("point2 is:(%0.2f,%0.2f)\n", x2, y2);
printf("the mid point is:(%0.2f,%0.2f)\n", midx, midy);
printf("The equation of a line in point-slope form is : y-%0.2f=%0.2f(x-%0.2f)\n",y1 ,m ,x1);
printf("The equation of the perpendicular bisector in slop-intercept form is : y=%+0.2fx%+lf\n",n ,c);
return 0;
}
